package com.daz.student.homeWork.server.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.daz.student.homeWork.dao.IHomeWorkFileDao;
import com.daz.student.homeWork.pojo.HomeWorkFilePojo;
import com.daz.student.homeWork.server.IHomeWorkFileSV;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class HomeWorkFileSVImpl implements IHomeWorkFileSV{
	@Autowired
	private IHomeWorkFileDao dao;

	@Override
	public PageInfo<HomeWorkFilePojo> getFileList(
			Map<String, Object> searchConditionMap, int pageNum, int pageSize)
			throws Exception {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		List<HomeWorkFilePojo> list = dao.getFileList(searchConditionMap);
		PageInfo<HomeWorkFilePojo> v =  new PageInfo<>(list);
		return new PageInfo<>(list);
		//return null;
	}

	@Override
	public void insert(HomeWorkFilePojo value) throws Exception {
		// TODO Auto-generated method stub
		dao.insert(value);
	}

	@Override
	public void deleteFile(Map<String, Object> searchConditionMap)
			throws Exception {
		// TODO Auto-generated method stub
		dao.deleteFile(searchConditionMap);
	}
	
}
